'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  //middleware 是中间件，就是能用到我们上面的方法
  const { router, controller, middleware } = app;
  const jwtErr = middleware.jwtErr(app.config.jwt) //检验token

  router.get('/', controller.home.index);
  router.post('/login', controller.login.index);
  router.get('/save',jwtErr, controller.home.save);
};
